#/bin/ash
cp /etc/config/idc_config /etc/config/idc_config.old
#1、下载程序

wget http://182.149.104.37:8090/openwrt_bin/packages/mipsel_24kc/sihan_idc/sihan-idc-service_1.1_mipsel_24kc.ipk
wget http://182.149.104.37:8090/openwrt_bin/packages/mipsel_24kc/sihan_idc/luci-app-idc-config_1.0_mipsel_24kc.ipk
wget http://182.149.104.37:8090/openwrt_bin/packages/mipsel_24kc/sihan_idc/luci-app-idc-client_1.0_mipsel_24kc.ipk

wget http://182.149.104.37:8090/start_proxy.sh
wget http://182.149.104.37:8090/stop_proxy.sh
chmod +x start_proxy.sh
chmod +x stop_proxy.sh
mv start_proxy.sh /bin
mv stop_proxy.sh /bin
#2、卸载程序
echo "remove luci-app-idc-config....."
opkg remove luci-app-idc-config
echo "remove luci-app-idc-mppt....."
opkg remove luci-app-idc-mppt
echo "remove luci-app-idc-client....."
opkg remove luci-app-idc-client
echo "remove sihan-idc-service....."
opkg remove sihan-idc-service
#3、安装程序
opkg install sihan-idc-service_1.1_mipsel_24kc.ipk
opkg install luci-app-idc-config_1.0_mipsel_24kc.ipk
opkg install luci-app-idc-client_1.0_mipsel_24kc.ipk

#4、修改配置文件
cp /etc/config/idc_config.old /etc/config/idc_config

#5、重启服务

service idc_service restart
